package com.example.printservice.Config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.StringHttpMessageConverter;
import org.springframework.web.servlet.config.annotation.*;

import java.nio.charset.Charset;
import java.util.List;

/**
 * @Author: Mr sheng.z
 * @Description:
 * @Date: Create in 10:11 2019/11/26
 */
@Configuration
@EnableWebMvc
public class WebMvcConfig implements WebMvcConfigurer {

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry){
        //上传的图片在D盘下的downLoad目录下，访问路径如：http://localhost:8899/downLoad/d3cf0281-bb7f-40e0-ab77-406db95ccf2c.jpg
        //file作用 指定文件传输协议 获取电脑文件一般都是file
        registry.addResourceHandler("/img/**").addResourceLocations("file:D:/print/result/");
    }

}
